package com.ruoyi.web.controller.ora;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.ora.domain.UserWhite;
import com.ruoyi.ora.redtea.model.RedteaResult;
import com.ruoyi.ora.redtea.service.IDeviceRedteaService;
import com.ruoyi.ora.service.IUserWhiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;

/**
 * 白名单Controller
 * 
 * @author liuwp
 * @date 2024-12-05
 */
@RestController
@RequestMapping("/ora/redtea")
public class RedteaController extends BaseController
{
    @Autowired
    private IDeviceRedteaService redteaService;

    /**
     * 查询白名单列表
     */
    @GetMapping("/test")
    public AjaxResult test()
    {
        List<String> iccids = new ArrayList<>();
//        iccids.add("898600801919P5612030");

        iccids.add("8943108178000217008");

        String startDate = "2024-12-05";
        String endDate = "2025-12-06";

        try {
            RedteaResult profileUsage = redteaService.getProfileUsage(iccids, startDate, endDate);
//            RedteaResult profileUsage = redteaService.getProfileList(iccids, null, 1, 10);

            System.out.println(profileUsage);

            return AjaxResult.success(profileUsage);
        }catch (Exception e) {
            e.printStackTrace();
        }
        return AjaxResult.success();

    }


}
